Completed
Push — master ( 12c703...196755 )
by Justin
02:02
created

module.exports   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 43

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 43
rs 8.8571

3 Functions

Rating   Name   Duplication   Size   Complexity  
A 0 3 1
A 0 6 2
A 0 6 2
1
/**
2
 * RS extensions to PlaceDescription
3
 */
4
module.exports = function(GedcomX){
5
  
6
  // Extend serialization properties
7
  GedcomX.PlaceDescription.jsonProps.push('display');
8
  
9
  // Override init() so that we can deserialize normalized values
10
  var oldInit = GedcomX.PlaceDescription.prototype.init;
11
  GedcomX.PlaceDescription.prototype.init = function(json){
12
    oldInit.call(this, json);
13
    if(json){
14
      this.setDisplay(json.display);
15
    }
16
  };
17
  
18
  /**
19
   * Set the display properties
20
   * 
21
   * @function setDisplay
22
   * @instance
23
   * @memberof PlaceDescription
24
   * @param {PlaceDisplayProperties} display
25
   * @return {PlaceDescription} this
26
   */
27
  GedcomX.PlaceDescription.prototype.setDisplay = function(display){
28
    if(display){
29
      this.display = GedcomX.PlaceDisplayProperties(display);
30
    }
31
    return this;
32
  };
33
  
34
  /**
35
   * Get the display properties
36
   * 
37
   * @function getDisplay
38
   * @instance
39
   * @memberof PlaceDescription
40
   * @return {PlaceDisplayProperties}
41
   */
42
  GedcomX.PlaceDescription.prototype.getDisplay = function(){
43
    return this.display;
44
  };
45
  
46
};